<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <script>
        //内置方法
        let title = 'hello';
        console.log(title.length);

        console.log(title.toUpperCase())    //大写
        console.log(title.toLowerCase())    //小写
        console.log(title.slice(1))    //切片
        console.log(title.slice(1, 3))    //切片

        let city = '北京 上海 深圳 广州'
        city.split(' ')
        citys = city.split(' ')
        console.log(citys)
        console.log(citys.length)

        let name = '  cai   '
        console.log(name.length)
        console.log(name.trim().length)//去除前后的空格


    </script>

</head>
<body>

</body>
</html>